home *** CD-ROM | disk | FTP | other *** search
- property sprLista -- Sprite que contem lista a ser scrollada
-
- property sprMe
- property intMinY, intDY -- Posicao possivel para o indicador assumir
-
- on getBehaviorDescription
- return "Trata do indicador de altura de scroll"
- end
-
- on getPropertyDescriptionList
- set p_list = [ ¬
- #sprLista: [ #comment: "Sprite que contem lista a ser scrollada", ¬
- #format: #integer, ¬
- #default: "" ] ¬
- ]
- return p_list
- end
-
- -- Primeiro captura dimensoes na tela do sprite da lista no qual
- -- ira scrollar
- on beginSprite me
- put the spriteNum of me into sprMe
- put 14 into intMinY
- move me, 0
- end
-
- -- Coloca list em uma certa posicao (1 - 10000)
- on move me, posicao
- put the locV of sprite sprLista into y
- put (the height of sprite sprLista) ¬
- - 15 - (the height of sprite sprMe) into intDY
- put y + intMinY + intDY * posicao / 10000 into y
- set the locV of sprite sprMe to y
- end
-
- -- Arraste
- on mouseDown me
- put (the height of sprite sprLista) ¬
- - 15 - (the height of sprite sprMe) into intDY
- put the mouseV into mY
- put the locV of sprite sprLista into y
- put y + intMinY into minY
- put minY + intDY into maxY
- put the locV of sprite sprMe into iniY
- put iniY - mY into dmY
- put iniY into mY
- repeat while the mouseDown
- put the mouseV + dmY into tmp
- if tmp < minY then put minY into tmp
- else if tmp > maxY then put maxY into tmp
- if tmp <> mY then
- put tmp into mY
- set the locV of sprite sprMe to mY
- sendSprite(sprLista, #scrollArraste, (mY - minY) * 10000 / intDY)
- updateStage
- end if
- end repeat
- sendSprite(sprLista, #scrollArrasteFim)
- end